import http from "@/utils/http";
import {
    CreatePictureClassForm,
    EditPictureClassForm,
    PictureClassPatientType,
    PictureClassType
} from "@/api/pictureClass/types";

/**
 * 图片类型列表
 */
export const pictureClassApi = async()=>{
    const res = await http.get<PictureClassType[]>("/v1/pictureType", {})
    return res.data
}


/**
 * 新增图片类型
 */
export const createPictureClassApi = async(params: CreatePictureClassForm)=>{
    const res = await http.post("/v1/pictureType", params)
    return res.data
}

/**
 * 编辑图片类型
 */
export const editPictureClassApi = async(params: EditPictureClassForm)=>{
    const res = await http.patch("/v1/pictureType", params)
    return res.data
}


/**
 * 删除图片类型
 */
export const deletePictureClassApi = async(id: number)=> {
    const res = await http.delete(`/v1/pictureType/${id}`, {})
    return res.data
}

/**
 * 获取患者的图片分类和对应的图片
 * @param id
 */
export const patientPictureTypeApi = async (id: number)=>{
    const res = await http.get<PictureClassPatientType[]>(`/v1/pictureType/patient/${id}`, {})
    return res.data
}